<template>
	<div class="sidebar">
		<el-menu
	      default-active="0-0"
	      class="el-menu-vertical-demo"
	      background-color="#3d414d"
	      text-color="#fff"
	      active-text-color="#41cac0">
	        <template v-for="(o,i) in navList">
	        	<el-menu-item @click="toPage(o.router,o.fn)" :index="i+''" v-if="!o.child">
			        <i :class="o.icon"></i>
			        <span slot="title">{{ o.text }}</span>
			    </el-menu-item>	
			     <el-submenu :index="i+''" v-if="o.child">
				    <template slot="title">
			            <i :class="o.icon"></i>
			            <span>{{ o.text }}</span>
				    </template>
				    <el-menu-item v-for="(c,ic)  in o.child" @click="toPage(c.router,c.fn)" :index="i+'-'+ic">
				        <i :class="c.icon"></i>
				        <span slot="title">{{ c.text }}</span>
				    </el-menu-item>	
			    </el-submenu>
			</template>
	   </el-menu>
	</div>
</template>
<style src="./style.css" scoped lang="less"></style>
<script src="./script.js"></script>